import {combineReducers, createStore} from 'redux';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import customizeReducer from "./customize";


const allReducer = combineReducers({
    customize: customizeReducer
})

const persistConfig = {
    key: 'server',
    storage,
}

export const store = createStore(persistReducer(persistConfig, allReducer));

// @ts-ignore
export const persist = persistStore(store)

export type RootState = ReturnType<typeof store.getState>
